package com.aliyun.messagemgt.feignapi;

import com.aliyun.messagemgt.common.dto.send.MsgPushDTO;
import com.aliyun.messagemgt.common.dto.send.SystemMsgPushDTO;
import com.aliyun.messagemgt.dto.in.ApiStatisticsQuery;
import com.aliyun.messagemgt.dto.in.MsgQuery;
import com.aliyun.messagemgt.dto.out.MsgPushResponseDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.Map;

/**
 * @author system
 * @date 2020-12-10 10:09:27
 */
@RestController
@Api(tags = "消息推送")
public interface PushAPIHttp {

//    /**
//     * 简单人工推送【2020年7月7日16:00:37】
//     *
//     * @param msgRecordVO
//     * @return
//     */
//    @RequestMapping("/simple/commonPush")
//    public Object push(@RequestBody MsgRecordVO msgRecordVO);

    /**
     * 图片上传oss返回url
     *
     * @param
     * @return
     */
    @RequestMapping("/simple/pictureToUrl")
    public Object pictureToUrl(@RequestParam MultipartFile file);

//    /**
//     * 对外推送接口
//     *
//     * @param
//     * @return
//     */
//    @RequestMapping("/push")
//    public Object msgPush(@Valid @RequestBody MsgPushVO msgPushVO, BindingResult bindingResult);

    /**
     * 消息接收及对外推送接口
     * @param msgPushDTO
     * @return
     */
    @RequestMapping(value = "/push",method = {RequestMethod.GET,RequestMethod.POST})
    @ApiOperation(value = "消息推送")
    @ApiResponses({
            @ApiResponse(code = 200, message = "消息推送响应信息", response = MsgPushResponseDTO.class)
    })
    Object msgPush(@Validated @RequestBody MsgPushDTO msgPushDTO);

    /**
     * 应用端消息接收
     * @param systemMsgPushDTO
     * @return
     */
    @PostMapping("/systemcsbmsg/receive")
    Object systemCsbMsgReceive(@RequestBody SystemMsgPushDTO systemMsgPushDTO);

    /**
     * 对外历史消息查询接口(分页)
     *
     * @param
     * @return
     */
    @RequestMapping("/list/history")
    Object listHistory(@RequestBody MsgQuery msgQuery);

    /**
     * 给门户系统提供消息中心各种渠道的统计数据
     *
     * @param apiStatisticsQuery 查询类
     * @return object
     */
    @PostMapping("/statistics/statisticsApi")
    Object statisticsApi(@Valid @RequestBody ApiStatisticsQuery apiStatisticsQuery);

    /**
     * 接收消息测试接口
     *
     * @param
     * @return
     */
    @RequestMapping("/receiveTest")
    Object receiveTest(@RequestBody Map map);

    @RequestMapping("/redisTest")
    Object redisTest(@RequestBody Map map);
}
